-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add loop component 🎁🎄 #5429
base: main
Are you sure you want to change the base?
Conversation
Oh, I wonder how it would work, can't wait to test it :-) Thanks for great work! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
The component works well in UI, Test case: #5615 |
- Renamed 'loop' input to 'loop_input' for clarity. - Simplified logic for checking loop input and aggregating results. - Enhanced type hints for better code readability and maintainability.
e839deb
to
2385623
Compare
Error in number of times the loops are executed. |
updated component with issue fixes: #5615 |
6ae069a
to
cc080fd
Compare
… Loop component updates to support API (#5615) * add loop component 🎁🎄 * [autofix.ci] apply automated fixes * fix: add loop component to init * [autofix.ci] apply automated fixes * refactor(loop): rename loop input variable and improve code quality - Renamed 'loop' input to 'loop_input' for clarity. - Simplified logic for checking loop input and aggregating results. - Enhanced type hints for better code readability and maintainability. * refactor(loop): add type hint to initialize_data method for improved clarity * adding test * test cases added * Update test_loop.py * adding test * test cases added * Update test_loop.py * update with the new test case method! * Update test_loop.py * tests updates * Update loop.py * update fix * issues loop issues * reverting debug mode params * solves lint errors and fix the tests * fix: mypy error incompatible return value type * [autofix.ci] apply automated fixes --------- Co-authored-by: Rodrigo Nader <rodrigosilvanader@gmail.com> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org> Co-authored-by: italojohnny <italojohnnydosanjos@gmail.com>
CodSpeed Performance ReportMerging #5429 will degrade performances by 25.59%Comparing Summary
Benchmarks breakdown
|
@italojohnny Do you know why the CI Fails? |
This pull request introduces the
LoopComponent
to the Langflow backend and includes corresponding tests and configuration updates. The most important changes include adding the new component, updating the initialization and configuration files, and creating tests for the new component.Adding the
LoopComponent
:src/backend/base/langflow/components/logic/__init__.py
: ImportedLoopComponent
and added it to the list of components. [1] [2]src/backend/base/langflow/components/logic/loop.py
: Implemented theLoopComponent
class, which iterates over a list ofData
objects, outputting one item at a time and aggregating results from loop inputs.Updating custom component functionality:
src/backend/base/langflow/custom/custom_component/custom_component.py
: Added thestart
method to handle the initiation of component processes.Configuration updates for tests:
src/backend/tests/conftest.py
: Added configurations forLoopTest.json
and created a fixture forjson_loop_test
. [1] [2] [3]Adding tests for
LoopComponent
:src/backend/tests/unit/components/logic/test_loop.py
: Created unit tests for theLoopComponent
to ensure its functionality and integration with the API.